import { mutableHandles, effect } from "./baseHandles.js";

const reactive = (target) => {
  if (typeof target !== "object") {
    console.warn(`reactive ${target} 必须是一个对象`);
    return target;
  }
  return new Proxy(target, mutableHandles);
};
let userInfo = reactive({ name: "zhen" });
console.log("userInfo=", userInfo.name);
setTimeout(() => {
  console.log("================");
  userInfo.name = "zzz";
}, 1000);
effect(
  () => {
    console.log("userInfo222=", userInfo.name);
  },
  { lazy: false }
);
// export default {};
